﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.master" AutoEventWireup="true"
    CodeFile="ContractManagement.aspx.cs" Inherits="PromotionInfo_ContractManagement"
    CodeFileBaseClass="Frame.Pages.ActionInfomationEditBasePage" %>

<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxTabControl" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2.Linq, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Data.Linq" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxGridView.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxGridView" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxRoundPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPanel" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dx" %>
<%@ Register Assembly="DevExpress.Web.v10.2, Version=10.2.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxClasses" TagPrefix="dx" %>
<asp:Content ID="head" ContentPlaceHolderID="head" runat="Server">
    <script type="text/javascript">
        function InitFee() {
            var fybm = Edit_fybm.GetValue();
            Edit_fylx.SetEnabled(true);
            Edit_fkfs.SetEnabled(true);
           $.ajax({
               type: "Post",
               url: "ContractManagement.aspx/GetFee",
               //方法传参的写法一定要对，str为形参的名字,str2为第二个形参的名字   
               data: "{'fybm': '" + fybm + "'}",
               contentType: "application/json; charset=utf-8",
               dataType: "json",
               success: function (data) {
                   //返回的数据用data.d获取内容
                   Edit_fylx.SetValue(data.d[0]);
                   Edit_fyje.SetText(data.d[1]);
                   Edit_fkfs.SetValue(data.d[2]);
                   Edit_kl.SetText(data.d[3]);
                   Edit_fylx.SetEnabled(false);
                   Edit_fkfs.SetEnabled(false);
               },
               error: function (err) {
                   //alert("费用信息获取失败,请重试！");
                   noty({ "text": "费用信息获取失败,请重试！",
                       "layout": "top",
                       "type": "error",
                       "animateOpen": { "height": "toggle" },
                       "animateClose": { "height": "toggle" },
                       "speed": 500,
                       "timeout": 1000,
                       "closeButton": false,
                       "closeOnSelfClick": true,
                       "closeOnSelfOver": false
                   });
               }
           });
        }
    </script>
</asp:Content>
<asp:Content ID="MainContent" ContentPlaceHolderID="MainContent" runat="Server">
    <h1 class="DemoTitle">
        合同管理
    </h1>
    <dx:ASPxRoundPanel ID="MainRoundPanel" runat="server" View="GroupBox" HeaderText="操作区"
        Width="100%" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
        EnableDefaultAppearance="False" GroupBoxCaptionOffsetX="6px" GroupBoxCaptionOffsetY="-19px"
        SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
        <ContentPaddings PaddingBottom="10px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="10px" />
        <HeaderStyle>
            <Paddings PaddingBottom="6px" PaddingLeft="9px" PaddingRight="11px" PaddingTop="3px" />
        </HeaderStyle>
        <PanelCollection>
            <dx:PanelContent ID="PanelContent1" runat="server" SupportsDisabledAttribute="True">
            </dx:PanelContent>
        </PanelCollection>
    </dx:ASPxRoundPanel>
    <div class="Spacer" style="height: 14px;">
    </div>
    <dx:ASPxGridView ID="gridView" runat="server" Width="100%" ClientInstanceName="grid"
        AutoGenerateColumns="False" DataSourceID="LSMDSourceMain" KeyFieldName="htbm"
        CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
        OnCellEditorInitialize="gridView_CellEditorInitialize" OnRowInserting="gridView_RowInserting"
        OnRowUpdating="gridView_RowUpdating" OnRowInserted="gridView_RowInserted" OnRowUpdated="gridView_RowUpdated">
        <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
            </LoadingPanelOnStatusBar>
            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
            </LoadingPanel>
        </Images>
        <ImagesFilterControl>
            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
            </LoadingPanel>
        </ImagesFilterControl>
        <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
            <Header ImageSpacing="5px" SortingImageSpacing="5px">
            </Header>
            <LoadingPanel ImageSpacing="5px">
            </LoadingPanel>
        </Styles>
        <StylesPager>
            <PageNumber ForeColor="#3E4846">
            </PageNumber>
            <Summary ForeColor="#1E395B">
            </Summary>
        </StylesPager>
        <StylesEditors ButtonEditCellSpacing="0">
            <ProgressBar Height="21px">
            </ProgressBar>
        </StylesEditors>
        <Columns>
            <dx:GridViewDataTextColumn Name="t_htbm" FieldName="htbm" VisibleIndex="0" CellStyle-HorizontalAlign="Left"
                Caption="合同编码" ReadOnly="True">
                <PropertiesTextEdit MaxLength="10" Width="200px" Style-Font-Size="10pt">
                    <ValidationSettings CausesValidation="true">
                        <RequiredField IsRequired="true" ErrorText="合同编码不可为空！"></RequiredField>
                    </ValidationSettings>
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Name="t_csbm" FieldName="csbm" VisibleIndex="1" CellStyle-HorizontalAlign="Left"
                Caption="供应商">
                <PropertiesComboBox Width="500px" DataSourceID="SqlDataSourceGys" IncrementalFilteringMode="Contains"
                    DropDownStyle="DropDown" ValueType="System.String" TextFormatString="{0};{1};{2}"
                    ValueField="csbm" Style-Font-Size="10pt">
                    <Columns>
                        <dx:ListBoxColumn FieldName="csbm" Caption="供应商编码" />
                        <dx:ListBoxColumn FieldName="csmc" Caption="供应商名称" />
                        <dx:ListBoxColumn FieldName="zjm" Caption="助记码" />
                    </Columns>
                    <Style Font-Size="10pt"></Style>
                </PropertiesComboBox>
                <EditFormSettings CaptionLocation="Near" ColumnSpan="2"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataComboBoxColumn Name="t_flag" FieldName="flag" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                Caption="生效标志">
                <PropertiesComboBox Width="200px" ShowImageInEditBox="true" DropDownStyle="DropDown"
                    ValueType="System.Char" Style-Font-Size="10pt">
                    <Items>
                        <dx:ListEditItem Text="是" Value="Y" ImageUrl="../Images/icon/A.png" />
                        <dx:ListEditItem Text="否" Value="N" ImageUrl="../Images/icon/Z.png" />
                    </Items>
                    <Style Font-Size="10pt"></Style>
                </PropertiesComboBox>
                <EditFormSettings CaptionLocation="Near" VisibleIndex="1"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn Name="t_qsrq" FieldName="qsrq" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                Caption="起始日期">
                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                    <MaskSettings Mask="yyyy/MM/dd" />
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_zzrq" FieldName="zzrq" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                Caption="终止日期">
                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                    <MaskSettings Mask="yyyy/MM/dd" />
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <%--            <dx:GridViewDataDateColumn Name="t_qsrq" FieldName="qsrq" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                Caption="起始日期">
                <PropertiesDateEdit Width="200px" EditFormat="Date" EditFormatString="yyyy/MM/dd"
                    Style-Font-Size="10pt" DisplayFormatInEditMode="True">
                    <Style Font-Size="10pt"></Style>
                </PropertiesDateEdit>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataDateColumn>
            <dx:GridViewDataDateColumn Name="t_zzrq" FieldName="zzrq" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                Caption="终止日期">
                <PropertiesDateEdit Width="200px" EditFormat="Date" EditFormatString="yyyy/MM/dd"
                    Style-Font-Size="10pt" DisplayFormatInEditMode="True">
                    <Style Font-Size="10pt"></Style>
                </PropertiesDateEdit>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataDateColumn>--%>
            <dx:GridViewDataTextColumn Name="t_fsrq" FieldName="fsrq" VisibleIndex="5" CellStyle-HorizontalAlign="Left"
                Caption="生效日期" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_qxrq" FieldName="qxrq" VisibleIndex="6" CellStyle-HorizontalAlign="Left"
                Caption="取消日期" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataComboBoxColumn Name="t_jsfs" FieldName="jsfs" VisibleIndex="7" CellStyle-HorizontalAlign="Left"
                Caption="结算方式">
                <PropertiesComboBox Width="200px" DropDownStyle="DropDown" ValueType="System.String"
                    Style-Font-Size="10pt">
                    <Items>
                        <dx:ListEditItem Text="扣率结算" Value="K" />
                        <dx:ListEditItem Text="固定场租" Value="C" />
                    </Items>
                    <Style Font-Size="10pt"></Style>
                </PropertiesComboBox>
                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataComboBoxColumn>
            <dx:GridViewDataTextColumn Name="t_jskl" FieldName="jskl" VisibleIndex="8" CellStyle-HorizontalAlign="Left"
                Caption="结算扣率" Visible="false">
                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                    <MaskSettings Mask="&lt;0..100&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                    </MaskSettings>
                    <ValidationSettings>
                        <RegularExpression ValidationExpression="^\+?((100(.0+)*)|([1-9]?[0-9])(\.\d+)*)$"
                            ErrorText="扣率不能大于100！" />
                    </ValidationSettings>
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near" Visible="True"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_zq" FieldName="zq" VisibleIndex="9" CellStyle-HorizontalAlign="Left"
                Caption="账期" Visible="false">
                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                    <MaskSettings Mask="&lt;0..9999&gt;" />
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near" Visible="True"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_bdje" FieldName="bdje" VisibleIndex="10" CellStyle-HorizontalAlign="Left"
                Caption="保底金额" Visible="false">
                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                    <MaskSettings Mask="&lt;0..9999999999g&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                    </MaskSettings>
                    <Style Font-Size="10pt"></Style>
                </PropertiesTextEdit>
                <EditFormSettings CaptionLocation="Near" Visible="True"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataMemoColumn Name="t_bz" FieldName="bz" VisibleIndex="11" CellStyle-HorizontalAlign="Left"
                Caption="备注" Visible="false">
                <PropertiesMemoEdit Width="500px" Height="60px" Style-Font-Size="10pt">
                    <Style Font-Size="10pt"></Style>
                </PropertiesMemoEdit>
                <EditFormSettings CaptionLocation="Near" Visible="True" ColumnSpan="2"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataMemoColumn>
            <dx:GridViewDataTextColumn Name="t_founder" FieldName="founder" VisibleIndex="12"
                CellStyle-HorizontalAlign="Left" Caption="创建者" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_fdate" FieldName="fdate" VisibleIndex="13" CellStyle-HorizontalAlign="Left"
                Caption="创建日期" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_editor" FieldName="editor" VisibleIndex="14" CellStyle-HorizontalAlign="Left"
                Caption="最后修订人" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
            <dx:GridViewDataTextColumn Name="t_edate" FieldName="edate" VisibleIndex="15" CellStyle-HorizontalAlign="Left"
                Caption="最后修订日期" Visible="false">
                <EditFormSettings Visible="False"></EditFormSettings>
                <CellStyle HorizontalAlign="Left">
                </CellStyle>
            </dx:GridViewDataTextColumn>
        </Columns>
        <Templates>
            <DetailRow>
                <table style="font-size: 10pt" width="600px">
                    <tr>
                        <td style="white-space: nowrap">
                            生效日期:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_qsrq" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("qsrq") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                        <td style="white-space: nowrap">
                            终止日期:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_zzrq" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("zzrq") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td style="white-space: nowrap">
                            结算扣率:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_jskl" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("jskl") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                        <td style="white-space: nowrap">
                            账期:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_zq" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("zq") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td style="white-space: nowrap">
                            保底金额:
                        </td>
                        <td colspan="3">
                            <dx:ASPxLabel Width="400px" ID="View_bdje" Wrap="true" Font-Size="10pt" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("bdje") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td style="white-space: nowrap">
                            备注:
                        </td>
                        <td colspan="3">
                            <dx:ASPxLabel Width="400px" ID="View_Remark" Wrap="true" Font-Size="10pt" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("bz") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td style="white-space: nowrap">
                            创建者:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_founder" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("founder") %>'
                                CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                        <td style="white-space: nowrap">
                            创建日期:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_fdate" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("fdate") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                    <tr>
                        <td style="white-space: nowrap">
                            最后修订人:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_editor" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("editor") %>'
                                CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                        <td style="white-space: nowrap">
                            最后修订日期:
                        </td>
                        <td>
                            <dx:ASPxLabel Width="200px" Font-Size="10pt" ID="View_edate" Wrap="true" runat="server"
                                CssFilePath="~/App_Themes/DevEx/{0}/styles.css" Text='<%# Eval("edate") %>' CssPostfix="DevEx">
                            </dx:ASPxLabel>
                        </td>
                    </tr>
                </table>
                <dx:ASPxPageControl ID="ASPxPageControl1" runat="server" Width="100%" ActiveTabIndex="0"
                    CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue"
                    SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css" TabSpacing="0px">
                    <TabPages>
                        <dx:TabPage Text="合同费用明细">
                            <ContentCollection>
                                <dx:ContentControl ID="ContentControl1" runat="server" SupportsDisabledAttribute="True">
                                    <dx:ASPxGridView ID="gridFy" AutoGenerateColumns="false" DataSourceID="FYMDSourceMain"
                                        runat="server" Width="100%" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                        CssPostfix="Office2010Blue" KeyFieldName="htbm;jlxh" OnLoad="gridDetail_Load"
                                        OnRowInserting="gridFy_RowInserting" OnCellEditorInitialize="gridFy_CellEditorInitialize">
                                        <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanelOnStatusBar>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </Images>
                                        <ImagesFilterControl>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </ImagesFilterControl>
                                        <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                            </Header>
                                            <LoadingPanel ImageSpacing="5px">
                                            </LoadingPanel>
                                        </Styles>
                                        <StylesPager>
                                            <PageNumber ForeColor="#3E4846">
                                            </PageNumber>
                                            <Summary ForeColor="#1E395B">
                                            </Summary>
                                        </StylesPager>
                                        <StylesEditors ButtonEditCellSpacing="0">
                                            <ProgressBar Height="21px">
                                            </ProgressBar>
                                        </StylesEditors>
                                        <Columns>
                                            <dx:GridViewDataTextColumn Name="t_htbm" FieldName="htbm" VisibleIndex="0" CellStyle-HorizontalAlign="Left"
                                                Caption="合同编码" Visible="false">
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Name="t_jlxh" FieldName="jlxh" VisibleIndex="1" CellStyle-HorizontalAlign="Center"
                                                Caption="记录序号" ReadOnly="true">
                                                <PropertiesTextEdit MaxLength="4" Width="200px" Style-Font-Size="10pt">
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesTextEdit>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataComboBoxColumn Name="t_fybm" FieldName="fybm" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                                                Caption="费用名称">
                                                <PropertiesComboBox Width="200px" Style-Font-Size="10pt" IncrementalFilteringMode="Contains">
                                                    <Style Font-Size="10pt"></Style>
                                                    <ClientSideEvents SelectedIndexChanged="InitFee" />
                                                </PropertiesComboBox>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataComboBoxColumn>
                                            <dx:GridViewDataComboBoxColumn Name="t_fylx" FieldName="fylx" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                                                Caption="计费方式" >
                                                <PropertiesComboBox Width="200px" DropDownStyle="DropDown" ValueType="System.String"
                                                    Style-Font-Size="10pt">
                                                    <Items>
                                                        <dx:ListEditItem Text="固定费用" Value="G" />
                                                        <dx:ListEditItem Text="临时费用" Value="L" />
                                                        <dx:ListEditItem Text="按销售总金额浮动扣率" Value="X" />
                                                        <dx:ListEditItem Text="按付款方式销售金额浮动扣率" Value="F" />
                                                    </Items>
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesComboBox>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataComboBoxColumn>
                                            <dx:GridViewDataTextColumn Name="t_fyje" FieldName="fyje" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                                                Caption="费用金额">
                                                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                                                    <MaskSettings Mask="&lt;0..9999999999g&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                                                    </MaskSettings>
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesTextEdit>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataComboBoxColumn Name="t_fkfs" FieldName="fkfs" VisibleIndex="5" CellStyle-HorizontalAlign="Left"
                                                Caption="付款方式">
                                                <PropertiesComboBox Width="200px"  Style-Font-Size="10pt"  IncrementalFilteringMode="Contains">
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesComboBox>
                                                <EditFormSettings CaptionLocation="Near" ></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataComboBoxColumn>
                                            <dx:GridViewDataTextColumn Name="t_kl" FieldName="kl" VisibleIndex="6" CellStyle-HorizontalAlign="Left"
                                                Caption="扣率">
                                                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                                                    <MaskSettings Mask="&lt;0..100&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                                                    </MaskSettings>
                                                    <ValidationSettings>
                                                        <RegularExpression ValidationExpression="^\+?((100(.0+)*)|([1-9]?[0-9])(\.\d+)*)$"
                                                            ErrorText="扣率不能大于100！" />
                                                    </ValidationSettings>
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesTextEdit>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataMemoColumn Name="t_bz" FieldName="bz" VisibleIndex="7" CellStyle-HorizontalAlign="Left"
                                                Caption="备注" Visible="false">
                                                <PropertiesMemoEdit Width="500px" Height="60px" Style-Font-Size="10pt">
                                                    <Style Font-Size="10pt"> 
                                                    </Style>
                                                </PropertiesMemoEdit>
                                                <EditFormSettings CaptionLocation="Near" Visible="True" ColumnSpan="2"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataMemoColumn>
                                        </Columns>
                                        <Templates>
                                            <PreviewRow>
                                                备注:<%#Eval("bz") %>
                                            </PreviewRow>
                                        </Templates>
                                        <SettingsDetail IsDetailGrid="true" />
                                        <SettingsEditing EditFormColumnCount="2" NewItemRowPosition="Top" />
                                        <Settings ShowPreview="true" />
                                    </dx:ASPxGridView>
                                    <dx:LinqServerModeDataSource ID="FYMDSourceMain" runat="server" EnableDelete="true"
                                        EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.DataClassesDataContext"
                                        TableName="css_contract_fee" OnSelecting="FYMDSourceMain_Selecting" />
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                        <dx:TabPage Text="合同商品明细">
                            <ContentCollection>
                                <dx:ContentControl ID="ContentControl2" runat="server" SupportsDisabledAttribute="True">
                                    <dx:ASPxGridView ID="gridSp" runat="server" Width="100%" DataSourceID="SPMDSourceMain"
                                        AutoGenerateColumns="false" CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css"
                                        CssPostfix="Office2010Blue" KeyFieldName="htbm;jlxh" OnLoad="gridDetail_Load"
                                        OnRowInserting="gridSp_RowInserting" OnCellEditorInitialize="gridSp_CellEditorInitialize">
                                        <Images SpriteCssFilePath="~/App_Themes/Office2010Blue/{0}/sprite.css">
                                            <LoadingPanelOnStatusBar Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanelOnStatusBar>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </Images>
                                        <ImagesFilterControl>
                                            <LoadingPanel Url="~/App_Themes/Office2010Blue/GridView/Loading.gif">
                                            </LoadingPanel>
                                        </ImagesFilterControl>
                                        <Styles CssFilePath="~/App_Themes/Office2010Blue/{0}/styles.css" CssPostfix="Office2010Blue">
                                            <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                            </Header>
                                            <LoadingPanel ImageSpacing="5px">
                                            </LoadingPanel>
                                        </Styles>
                                        <StylesPager>
                                            <PageNumber ForeColor="#3E4846">
                                            </PageNumber>
                                            <Summary ForeColor="#1E395B">
                                            </Summary>
                                        </StylesPager>
                                        <StylesEditors ButtonEditCellSpacing="0">
                                            <ProgressBar Height="21px">
                                            </ProgressBar>
                                        </StylesEditors>
                                        <Columns>
                                            <dx:GridViewDataTextColumn Name="t_htbm" FieldName="htbm" VisibleIndex="0" CellStyle-HorizontalAlign="Left"
                                                Caption="合同编码" Visible="false">
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataTextColumn Name="t_jlxh" FieldName="jlxh" VisibleIndex="1" CellStyle-HorizontalAlign="Center"
                                                Caption="记录序号" ReadOnly="true">
                                                <PropertiesTextEdit MaxLength="4" Width="200px" Style-Font-Size="10pt">
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesTextEdit>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Center">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataComboBoxColumn Name="t_spbm" FieldName="spbm" VisibleIndex="2" CellStyle-HorizontalAlign="Left"
                                                Caption="商品">
                                                <PropertiesComboBox Width="500px" DataSourceID="SqlDataSourceSp" IncrementalFilteringMode="Contains"
                                                    DropDownStyle="DropDownList" ValueType="System.String" TextFormatString="{0};{1}"
                                                    ValueField="spbm" Style-Font-Size="10pt">
                                                    <Columns>
                                                        <dx:ListBoxColumn FieldName="spmc" Caption="商品名称" />
                                                        <dx:ListBoxColumn FieldName="zjm" Caption="助记码" />
                                                    </Columns>
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesComboBox>
                                                <EditFormSettings CaptionLocation="Near" ColumnSpan="2"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataComboBoxColumn>
                                            <dx:GridViewDataTextColumn Name="t_kl" FieldName="kl" VisibleIndex="3" CellStyle-HorizontalAlign="Left"
                                                Caption="扣率">
                                                <PropertiesTextEdit Width="200px" Style-Font-Size="10pt">
                                                    <MaskSettings Mask="&lt;0..100&gt;.&lt;00..99&gt;" IncludeLiterals="DecimalSymbol">
                                                    </MaskSettings>
                                                    <ValidationSettings>
                                                        <RegularExpression ValidationExpression="^\+?((100(.0+)*)|([1-9]?[0-9])(\.\d+)*)$"
                                                            ErrorText="扣率不能大于100！" />
                                                    </ValidationSettings>
                                                    <Style Font-Size="10pt"></Style>
                                                </PropertiesTextEdit>
                                                <EditFormSettings CaptionLocation="Near"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataTextColumn>
                                            <dx:GridViewDataMemoColumn Name="t_bz" FieldName="bz" VisibleIndex="4" CellStyle-HorizontalAlign="Left"
                                                Caption="备注" Visible="false">
                                                <PropertiesMemoEdit Width="500px" Height="60px" Style-Font-Size="10pt">
                                                    <Style Font-Size="10pt">
                                                        
                                                    </Style>
                                                </PropertiesMemoEdit>
                                                <EditFormSettings CaptionLocation="Near" Visible="True" ColumnSpan="2"></EditFormSettings>
                                                <CellStyle HorizontalAlign="Left">
                                                </CellStyle>
                                            </dx:GridViewDataMemoColumn>
                                        </Columns>
                                        <Templates>
                                            <PreviewRow>
                                                备注:<%#Eval("bz") %>
                                            </PreviewRow>
                                        </Templates>
                                        <SettingsDetail IsDetailGrid="true" />
                                        <SettingsEditing NewItemRowPosition="Top" />
                                        <Settings ShowPreview="true" />
                                    </dx:ASPxGridView>
                                    <dx:LinqServerModeDataSource ID="SPMDSourceMain" runat="server" EnableDelete="true"
                                        EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.DataClassesDataContext"
                                        TableName="css_contract_sp" OnSelecting="SPMDSourceMain_Selecting" />
                                </dx:ContentControl>
                            </ContentCollection>
                        </dx:TabPage>
                    </TabPages>
                    <LoadingPanelImage Url="~/App_Themes/Office2010Blue/Web/Loading.gif">
                    </LoadingPanelImage>
                    <LoadingPanelStyle ImageSpacing="5px">
                    </LoadingPanelStyle>
                    <Paddings Padding="2px" PaddingLeft="5px" PaddingRight="5px" />
                    <ContentStyle>
                        <Paddings Padding="12px" />
                        <Border BorderColor="#859EBF" BorderStyle="Solid" BorderWidth="1px" />
                    </ContentStyle>
                </dx:ASPxPageControl>
            </DetailRow>
        </Templates>
        <Settings ShowFilterRow="true" />
        <SettingsDetail ShowDetailRow="true" ShowDetailButtons="true" />
        <SettingsEditing EditFormColumnCount="2" Mode="PopupEditForm" PopupEditFormHorizontalAlign="WindowCenter"
            PopupEditFormVerticalAlign="WindowCenter" />
    </dx:ASPxGridView>
    <dx:LinqServerModeDataSource ID="LSMDSourceMain" runat="server" EnableDelete="true"
        EnableUpdate="true" EnableInsert="true" ContextTypeName="DAL.DataClassesDataContext"
        TableName="css_contract" />
    <asp:SqlDataSource ID="SqlDataSourceGys" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
        SelectCommand="Select csbm,
                              csmc,
		                      zjm
                       from   css_csdj 
                       where  hdbz = 'A'
                   order by   csbm" runat="server" ProviderName="<%$ ConnectionStrings:CMSConnectionString.ProviderName %>">
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSourceSp" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
        SelectCommand="Select spbm,
                              spmc,
		                      zjm
                       from   css_spjbxx
                   order by   spbm" runat="server" ProviderName="<%$ ConnectionStrings:CMSConnectionString.ProviderName %>">
    </asp:SqlDataSource>
</asp:Content>
